{extend name="admin@public/base_content" /}
{block name="body">}
<body>
{include file="admin@public/common" /}
<div class="container-fluid larry-wrapper">
    <div class="row">
        <div class="col-xs-12 col-sm-12 col-md-12">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form layui-form-pane" action="{:url('')}">
                    <div class="layui-form-item">
                        <label class="layui-form-label">活动名称</label>
                        <div class="layui-input-block">
                            <input type="text" name="title" value="{$info.title|default=''}" jq-verify="" jq-error="请输入活动名称" placeholder="请输入活动名称" class="layui-input ">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">形象图</label>
                        <div class="layui-input-block">
                            <input type="file" name="imgurl" class="layui-upload-file" id="upload_one">
                            <input type="hidden" name="imgurl" value="{$info.imgurl|default=''}" jq-error="请上传形象图" error-id="img-error">
                            <p id="img-error" class="error"></p>
                        </div>
                        {notempty name="info.image"}
                        <div class="layui-input-block">
                            <div class="imgbox"><img src="{$info.image|default=''}" alt="..." class="img-thumbnail"></div>
                        </div>
                        {/notempty}
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">介绍</label>
                        <div class="layui-input-block">
                            <textarea name="content" class="content" cols="100" rows="20">{$info.content|default=''}</textarea>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">分类</label>
                        <div class="layui-input-inline">
                            <select class="tpl-form-input" jq-verify="required" jq-error="请选择分类" lay-filter="verify" name="cate_id">
                                <option value="">请选择分类</option>
                                {foreach name="cates" item="vo"}
                                <option value="{$vo.cate_id}" {if condition="$vo.cate_id eq $info.cate_id"}selected{/if}>{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">类别</label>
                        <div class="layui-input-inline">
                            <select class="tpl-form-input" jq-verify="required" jq-error="请选择类别" lay-filter="verify" name="type_id">
                                <option value="">请选择类别</option>
                                {foreach name="types" item="vo"}
                                <option value="{$vo.type_id}" {if condition="$vo.type_id eq $info.type_id"}selected{/if}>{$vo.name}</option>
                                {/foreach}
                            </select>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">开始时间</label>
                        <div class="layui-input-block">
                            <input name="starttime" value="{$info.starttime|default=$Think.NOW_TIME}" id="starttime" lay-verify="date" placeholder="开始时间" class="layui-input" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm'})" type="text">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">结束时间</label>
                        <div class="layui-input-block">
                            <input name="endtime" value="{$info.endtime|default=$Think.NOW_TIME}" id="endtime" lay-verify="date" placeholder="结束时间" class="layui-input" onclick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD hh:mm'})" type="text">
                        </div>
                    </div>
                    <div class="layui-form-item" pane>
                        <label class="layui-form-label">限制次数</label>
                        <div class="layui-input-inline">
                            <input type="text" name="signnum"  jq-verify="number" value="{$info.signnum|default='0'}" jq-error="设置报名次数上限" placeholder="设置报名次数上限" class="layui-input ">
                        </div>
                    </div>

                    <div class="layui-form-item" pane>
                        <label class="layui-form-label">活动状态</label>
                        <div class="layui-input-inline">
                            <input type="radio" name="status" {eq name="info.status" value="1"}checked{/eq} title="正常" value="1" checked />
                            <input type="radio" name="status" {eq name="info.status" value="2"}checked{/eq} title="禁用" value="2" />
                        </div>
                    </div>
                    <div class="layui-input-block">
                        <input type="hidden" name="activity_id" type="hidden" value="{$info.activity_id|default=''}">
                        <button class="layui-btn" jq-submit lay-filter="submit" jq-tab="true">立即提交</button>
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
</body>
{/block}
{block name="script"}
<script>
    //document.domain = 'domain.com';
    KindEditor.ready(function(K) {
        window.editor = K.create('.content', {
            allowFileManager : true,
            langType : 'zh-CN',
            autoHeightMode : true,
            afterBlur: function () { this.sync(); },
        });
    });
</script>
<script>
    layui.use('myform');
    laydate.render({
        elem: '#test1'
        ,format: 'yyyy年MM月dd日'
    });
    laydate.render({
        elem: '#test2'
        ,format: 'yyyy年MM月dd日'
    });

    layui.use('layedit', function(){
        var layedit = layui.layedit;
        layedit.build('demo'); //建立编辑器
    });

</script>
{/block}